﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using LibFriesland_Campina_CRM;

namespace WebServiceFriesland_Campina_CRM
{
    /// <summary>
    /// Summary description for FCWareHousingWS
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class FCWareHousingWS : System.Web.Services.WebService
    {
        [WebMethod]
        public int addWareHousingbyNA(string pWarehousing_charid, string pDatetime_phone_warehousing, string pBy_product, int pQuantity, string pBy_shop, string pBy_na)
        {
            if (pQuantity > 0)
            {
                BizWareHousing wareHousing = new BizWareHousing(pWarehousing_charid, Thuvien.myConvertDatetimeToString(DateTime.Now), pDatetime_phone_warehousing, pBy_na, pBy_shop);
                BizWareHousingDetail wareHousingDetail = new BizWareHousingDetail(pWarehousing_charid, pBy_product, pQuantity);
                return BizWareHousing.addWareHousingbyNA(wareHousing, wareHousingDetail);
            }
            else
                return 0;
        }
    }
}
